home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Taifun
/
Taifun 182 (1991-12-10)(Manewaldt, A.)(DE)(PD).zip
/
Taifun 182 (1991-12-10)(Manewaldt, A.)(DE)(PD).adf
/
Sketch_A_Tune
/
Spconvert
/
Spconvert.amosSourceCode
Wrap
AMOS Source Code
|
1991-12-05
|
3KB
|
142 lines
Global MOBNUMBER,LODE$,A,B,BSSTART,BLSTART,CON,AERROR
AERROR=0
PREPARE1
PREPARE2
Do
Exit If Mouse Click=1
Loop
PREPARE3
Do
If Hzone(,X Mouse,Y Mouse)=1 Then CON=1
If Hzone(,X Mouse,Y Mouse)=2 Then CON=0
Exit If Mouse Click<>0
Loop
BINARYLOAD
REARRANGE
BINARYSAVE
COMPLETE
Procedure PREPARE1
Screen Open 0,320,256,4,Lowres
Paper 0
Pen 1
Flash Off
Palette $0,$1E1,$60,$E80
Curs Off
Cls
End Proc
Procedure PREPARE2
Cls
Set Pattern 0 : Set Paint 1
Ink 2,,3
Bar 20,24 To 298,120
Paper 2
Locate ,5
Centre "Mobed to Sprite Convertor"
Cdown : Cdown
Centre "Written By Martin Jones"
Cdown : Cdown
Centre "Written using AMOS"
Cdown : Cdown
Centre "Copyright (c) 1990 Mandarin/Jawx"
Cdown : Cdown
Centre "Click mouse to continue"
End Proc
Procedure PREPARE3
Paper 0
Cls
Set Pattern 0 : Set Paint 1
Ink 2,,3
Bar 20,24 To 298,120
Paper 2
Locate ,6
Centre "Do you want control words saved ??"
Locate 7,11
Print "Yes No"
Ink 1
Box 52,85 To 82,98
Box 244,85 To 268,98
Reserve Zone 3
Set Zone 1,52,85 To 82,98 : Set Zone 2,244,85 To 268,98
End Proc
Procedure BINARYLOAD
LODE$=Fsel$("","Mobdefault","Which file do you want to convert ?","")
If LODE$="" Then AERROR=1 : AERPROC
If Not Exist(LODE$) Then AERROR=7 : AERPROC
Paper 0
Pen 1
Cls
Locate ,13
Centre "Loading file "+LODE$
Reserve As Work 8,32768
BLSTART=Start(8)
Bload LODE$,8
If Peek(BLSTART)<>Asc("B") or Peek(BLSTART+1)<>Asc("I") or Peek(BLSTART+2)<>Asc("N") Then AERROR=2 : AERPROC
A=Leek(BLSTART+4)
If Btst(4,A) Then AERROR=3 : AERPROC
If Btst(5,A) Then AERROR=4 : AERPROC
B=A
B=B and 15
If B<>2 Then AERROR=5 : AERPROC
A=A and $F00
A=A/$100
If A<>2 and A<>4 Then AERROR=6 : AERPROC
FILELENGTH=Leek(BLSTART+16)
MOBNUMBER=FILELENGTH/64
End Proc
Procedure REARRANGE
Paper 0
Cls
Locate ,13
Centre "Processing...."
Reserve As Work 9,32768
Add BLSTART,20
BSSTART=Start(9)
For I=1 To MOBNUMBER
If CON=1 Then Doke BSSTART,0 : Add BSSTART,2
BLSTART2=BLSTART+32
For K=1 To 16
A=Deek(BLSTART)
B=Deek(BLSTART2)
Doke BSSTART,A
Doke BSSTART+2,B
Add BSSTART,4
Add BLSTART,2
Add BLSTART2,2
Next
Add BLSTART,32
Next
End Proc
Procedure BINARYSAVE
BEND=BSSTART-2
SAVFE$=LODE$+".sp"
Cls
Locate ,13
Centre "Saving the file now...."
Print : Print
Print SAVFE$
Bsave SAVFE$,Start(9) To BEND
End Proc
Procedure COMPLETE
Cls
Locate ,13
Centre "File converted !"
Wait 200
End
End Proc
Procedure AERPROC
Paper 0
Cls
Colour 1,0
Pen 1
Flash 0,"(f00,20)(f80,20)"
Locate ,13
If AERROR=1 Then Centre "Conversion Aborted !!" : Goto OUT
If AERROR=2 Then Centre "Not a Mobed binary file !!" : Goto OUT
If AERROR=3 Then Centre "File has BLIT words cannot convert!" : Goto OUT
If AERROR=4 Then Centre "File has MASK information cannot convert!" : Goto OUT
If AERROR=5 Then Centre "Mobs must be 16 * 16 pixels !!" : Goto OUT
If AERROR=6 Then Centre "Only 4 & 2 planes allowed !!" : Goto OUT
If AERROR=7 Then Centre "Can't find file " : Goto OUT
OUT: Wait 400
End
End Proc